package com.jar.exercise.多线程.同步操作;

public class 线程终结规则 {
    static int a = 1;

    public static void main(String[] args) {
        Thread tb = new Thread(() -> {
            a = 2;
        });
        Thread ta = new Thread(() -> {
            try {
                tb.join();
            } catch (InterruptedException e) {
                //NO
            }
            System.out.println(a);
        });

        ta.start();
        tb.start();

    }
}
